package org.zjx.window.action.impl;


import org.zjx.command.util.ImageUtil;
import org.zjx.window.action.Action;
import org.zjx.window.operation.WindowOperation;
import org.zjx.window.util.HwndUtil;
import org.zjx.window.window.IWindow;

import java.awt.*;
import java.awt.image.BufferedImage;

public class ClickStartAction extends Action {
    private final Rectangle startButtonRect = new Rectangle(854, 478, 73, 55);
    private final Rectangle startButtonRect2 = new Rectangle(741, 478, 73, 55);
    private static final String buttonImage = "iVBORw0KGgoAAAANSUhEUgAAAEMAAAAxCAYAAACBIBS5AAAfx0lEQVR42r2Y91eU59rv/Q/2Xju6LREJyKZFNJbYYokaxQLDgIqgNOmhI1KmZmaYBkMHGVBEqmID7Iqa2NDEGEVjQ2OPKfsk73vOXmftX7/ne9/DoO7sd63zrnXW+eGz7vspw/N8r+91Xff9MOb4nf/E9ef/GzfJ4ON/4NSd/4XDN/4DHdd+Q92Xv6J84BfYT/4ssY2Mb1N+6hc43qKc58pO/CxHx8lfUPEWlf+C4xjvO/qzHKt57KbqBDnO+YkRxPyYi6qj/Ft9P7no/QmVffxt/8+o5fk63lfHe2qP/IIanhfU9f/yB6oP/4TqQz+hvu8XOI//HfW9fO/W1xgzOPwP3HjCQDz8B84M/U/0fsNAXPofaDz/K8r4krajLqx8uIUPF6OND7dybjn8Wo52Hkt6eZ4Psh4SvIaNo53HZXypMl6z87icY/nhn+XoEOcO8J6e13Acdh1XCMT1/byX1xwcKw7y3AGe636Niv0/S+ydr2DteAlbxyuUdf6I8k5e62ZweK2q52dUcl7e8SMcHa9R2fmTpKqL1ziWtb5E2e6XqGx/jboeBq6Tf9v5I8ZcfvAPXLn/D5y88Z84PPg7Os7/HU66U97/E0oP/IjS/eTA6zfsfw1zz48wdfM8MfPYepCBoaDSrlco7XRh7uK1TsErOdr28Z4u17GFxwJb12vYiYUvbaOYMgqwcyznaN3zo8TWJsZXsHFu59zW+gp2zssopLT5BYzOZzA5n8PMuW3nK4m95RXKd/P+Zj6r8SWszpdy7mhh0HfxHeqfo7TuGSwc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kTeAWejyzbjyzclwDksY1IWFsA5KZFbnj9yJ3AvcgLJdM8TuuFrmTOpDPlSN/chfy+dwij/1QeRyAZsohVE47i/YlN9C75r4MxIUNv2JMS9Ighvp/xIOzf8d3Pa/Rl3MfFbOvwTH9KhxBV1EeNChxTOMY+BYBgiuoCLiKSv9rqPC/OsIgKvwEV0dG/nZkrPC9Agep8OE5nyuo8rmKOp8bqJn6DRxTL6PM6+I7lJNKr0HUeF5DuedF2Kd8JceyKRdg9ziPMo8LqPC8hAqvS6j1uop672vY4XsNTf7fYGfAt2iZ9h1ap9/CnulDaJs1hH3z7uHwwmEcWfYEJ1e/xLmwn3Ex4u+4HPE7Lq79D/wfxTqhlBlVTmMAAAAASUVORK5CYII=";

    public ClickStartAction(IWindow targetWindow) {
        super(targetWindow, true);
    }

    @Override
    protected void doExecute() {
        if (!HwndUtil.haveWindow(targetWindow.getHwnd())) {
            return;
        }
        correctionMouse();
        targetWindow.flushScreenshot();
        BufferedImage screenshot = targetWindow.getScreenshot();
        clickStartButton(screenshot, startButtonRect);
        clickStartButton(screenshot, startButtonRect2);
        targetWindow.submitAction(new DelayAction(targetWindow, 3000));
    }

    //矫正鼠标遮挡按钮情况
    private void correctionMouse(){
        Point point = targetWindow.getExecutor().getMousePosition();
        Rectangle windowArea = targetWindow.getTrueBounds();
        Rectangle startButtonArea = new Rectangle(windowArea.x + startButtonRect.x, windowArea.y + startButtonRect.y, startButtonRect.width, startButtonRect.height);
        Rectangle startButtonArea2 = new Rectangle(windowArea.x + startButtonRect2.x,windowArea.y + startButtonRect2.y, startButtonRect2.width, startButtonRect2.height);
        if (startButtonArea.contains(point) || startButtonArea2.contains(point)) {
            targetWindow.execute(WindowOperation.move((int)windowArea.getCenterX(),(int)windowArea.getCenterY()));
            targetWindow.execute(WindowOperation.delay(100));
        }
    }

    public void clickStartButton(BufferedImage screenshot, Rectangle startButtonRect) {
        if (haveStartImage(screenshot, startButtonRect)) {
            Rectangle windowLocation = targetWindow.getBounds();
            Point point = new Point((int) startButtonRect.getCenterX() + windowLocation.x, (int) startButtonRect.getCenterY() + windowLocation.y);

            targetWindow.actions().moveTo(point).delay(30).click();
        }
    }

    public boolean haveStartImage(BufferedImage screenshot, Rectangle startButtonRect) {
        if (screenshot == null) return false;
        BufferedImage image = ImageUtil.cutImage(screenshot, startButtonRect);
        BufferedImage button = ImageUtil.stringToBufferedImage(buttonImage);
        return !ImageUtil.matchTemplate(image, button).isEmpty();
    }
}
